function [tsr] = slowshift(funct,N,D,M,eps)
% slowshift(funct,N,D,M,eps)
% 	Parameters:
% 		funct:	the function used to create a time series
% 		N:	the number of elements in the time series
% 		D:	initial displacement
% 		M:	the kernel size
% 		eps:	perturbation used to make diplacement a function of time
% 
% 	Outputs:
% 		tsr:	time series shifted by interpolation using one filter per time step
% 
% 	Purpose of this code:  This code will use windowed fractional filtered displacement to shift a time series, but in an inefficient manner
% 	by creating a filter for each time step and then extracting the correct element from the resulting shifted time series to make
% 	a shift where displacement is a function of time.

%hold off;

%% Establish Time Series
mesh = 1:N;
ts = funct(mesh);

%% Generate New Time Series For Given Position(pos), Displacement(D),
%  And Sample Delay(eps)
for j = 1:N
    tsa = FDtest(ts,D+(j-1).*eps,M);
    tsr(j) = tsa(j);
end

%% Shift Time Series via Interpolation
%tsint = epsshift(funct,D,N,M,eps);
%plot(mesh,tsint,'b');

%% Calculate Error (Interpolation Vs. Slow Interpolation)
%for j = 1:N
%err(j) = abs(tsr(N-(j-1)) - tsint(1+(j-1)))./abs(tsr(N-(j-1)));
%end
%semilogy(mesh,err,'g');
%xlim([D + (M-1),N]);

%% Calculate Error (Slow Interpolation Vs. Analytic)
%err2 = abs(tsan - tsint)./abs(tsan);
%semilogy(mesh,err2,'g');
%xlim([D + (M-1),N]);

end